<template>
	<view>
		<fui-tabbar :tabBar="tabBar" :selectedColor="selectedColor" :hump="hump" :current="current"
			@click="tabbarSwitch" color="#CCCCCC">
		</fui-tabbar>
	</view>
</template>
<script>
	export default {
		name: "tabBar",
		data() {
			return {
				hump: true,
				current: 0,
				selectedColor: "#AE00FF",
				tabBar: [{
						"pagePath": "group",
						"text": "首页",
						"iconPath": "/static/images/tabbar/index.png",
						"selectedIconPath": "/static/images/tabbar/index-active.png",
					},
					{
						"pagePath": "frend",
						"text": "好友",
						"iconPath": "/static/images/tabbar/frend.png",
						"selectedIconPath": "/static/images/tabbar/frend-active.png",
						"verify": true
					},
					{
						"pagePath": "hi",
						"text": "消息",
						"iconPath": "/static/images/tabbar/hi.png",
						"selectedIconPath": "/static/images/tabbar/hi-active.png",
						"verify": true
					},
					{
						"pagePath": "mys",
						"text": "我的",
						"iconPath": "/static/images/tabbar/member.png",
						"selectedIconPath": "/static/images/tabbar/member-active.png",
						"verify": true
					},
				],
			}
		},
		props: {
			currentindex: {
				type: Number,
				default: 0
			}
		},
		created() {
			let that = this
			this.current = that.$store.state.currentindex
			// console.log('切换页面', this.current)
		},
		methods: {
			tabbarSwitch(e) {
				let that = this
				//获取登录状态，此处默认未登录
				let isLogin = false
				// console.log('切换页面',e.pagePath,e,e.index)
				that.$store.state.currentindex = e.index
				that.$forceUpdate()
				// console.log('当前第几个', e.index, e, e.name)
				that.$Router.replaceAll({name:e.pagePath})
			},
		}
	}
</script>

<style >

</style>
